package test

import (
	"testing"
	"autoCRUD/models"
	"net/http"
)

func TestSpiderItem_Add(t *testing.T){
	spiderItem := &models.SpiderItem{Login:"testAddLogin"}
	Post_AssertCode(t,"/res/spiderItem/add",spiderItem,http.StatusOK)
}

func TestSpiderItem_Update(t *testing.T){
	spiderItem := &models.SpiderItem{Id:1,Login:"testUpdateLogin"}
	Post_AssertCode(t,"/res/spiderItem/update",spiderItem,http.StatusOK)
}

func TestSpiderItem_Delete(t *testing.T){
	type ID struct {
		Id int `json:"id"`
	}
	id := &ID{Id:2}
	Post_AssertCode(t,"/res/spiderItem/delete",id,http.StatusOK)
}

func TestSpiderItem_List(t *testing.T){
	Get_AssertCode(t,"/res/spiderItems",http.StatusOK)
}

func TestSpiderItem_SpiderItemById(t *testing.T){
	Get_AssertCode(t,"/res/spiderItem?id=1",http.StatusOK)
}
